<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>

    <script>
        var iNum = 10;
        var fNum = 10.1;
        var sStr = "123";
        // 把数字类型转化成字符串 进行相加
        // var iResult = iNum + sStr;
        // alert(iResult);
        // var iResult = fNum + sStr;
        // alert(iResult);

        var iResult = fNum + parseInt(sStr);
        alert(iResult);

    </script>
</head>
<body>

</body>
</html>